<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 数组转化为字符串
        let arr = [2, 3, 4, 5, 56, 45, 3];

        // 用toString()将数组转化为字符串
        console.log(arr.toString());
        // 使用join()将数组转化为字符串,默认用逗号拼接
        console.log(arr.join());

        console.log(arr.join("-"));
    </script>
</body>

</html>